const dbConfig = require('../config/db.config');
const Sequelize = require('sequelize');
const sequelize = new Sequelize(dbConfig.DB, dbConfig.USER, dbConfig.PASSWORD, {
  host: dbConfig.HOST,
  dialect: dbConfig.dialect,
  pool: dbConfig.pool
});

const db = {};

db.Sequelize = Sequelize;
db.sequelize = sequelize;

db.User = require('./user.model.js')(sequelize, Sequelize);
db.Record = require('./record.model.js')(sequelize, Sequelize);
db.Bar = require('./bar.model.js')(sequelize,Sequelize);
db.BarTable = require('./barTable.model.js')(sequelize, Sequelize);
db.BarActivity = require('./barActivity.model.js')(sequelize, Sequelize);
db.Game = require('./game.model.js')(sequelize, Sequelize);
db.Luck = require('./luck.model.js')(sequelize, Sequelize);

module.exports = db;
